package cn.iocoder.yudao.module.tms.dal.mysql.companybaseinfo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.tms.dal.dataobject.companybaseinfo.CompanyBaseInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.tms.controller.admin.companybaseinfo.vo.*;

/**
 * 公司基本信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CompanyBaseInfoMapper extends BaseMapperX<CompanyBaseInfoDO> {

    default PageResult<CompanyBaseInfoDO> selectPage(CompanyBaseInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CompanyBaseInfoDO>()
                .likeIfPresent(CompanyBaseInfoDO::getShortName, reqVO.getShortName())
                .likeIfPresent(CompanyBaseInfoDO::getFullName, reqVO.getFullName())
                .likeIfPresent(CompanyBaseInfoDO::getEnglishName, reqVO.getEnglishName())
                .eqIfPresent(CompanyBaseInfoDO::getAddress, reqVO.getAddress())
                .eqIfPresent(CompanyBaseInfoDO::getServiceProject, reqVO.getServiceProject())
                .eqIfPresent(CompanyBaseInfoDO::getSocialCreditCode, reqVO.getSocialCreditCode())
                .eqIfPresent(CompanyBaseInfoDO::getIntroduction, reqVO.getIntroduction())
                .eqIfPresent(CompanyBaseInfoDO::getRegisteredCapital, reqVO.getRegisteredCapital())
                .betweenIfPresent(CompanyBaseInfoDO::getAccountOpeningDate, reqVO.getAccountOpeningDate())
                .eqIfPresent(CompanyBaseInfoDO::getBankAccountInfo, reqVO.getBankAccountInfo())
                .betweenIfPresent(CompanyBaseInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CompanyBaseInfoDO::getId));
    }

}